<?php
/**
 * Created by PhpStorm.
 * User: Cao
 * Date: 09/10/2014
 * Time: 11:55
 */
class dashboard extends CI_Controller
{
    public function __construct(){
        parent::__construct();
        $this->load->helper("url");
    }
    public function index(){
        $sess_id = $this->session->userdata('user_id'); if(empty($sess_id)) {$this->load->view('login/index');}
        if ($sess_id['level']!=1)
        {
            $this->session->unset_userdata('user_id');
            $data['error']="Bạn không có quyền";
            $this->load->view("login/index",$data);

        }
        else
        {
            $data['path']="dashboard/content_index";
            $data['title']= "Chào mừng bạn đến với DashBoard";
            $this->load->view("dashboard/index",$data);
        }
    }
}